package com.feng.zhihao.apigeteway.entity;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ChannelInterface entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CHANNEL_INTERFACE")

public class ChannelInterface implements java.io.Serializable {

	// Fields

	private ChannelInterfaceId id;
	private ModularInfo modularInfo;
	private InterfaceInfo interfaceInfo;
	private ChannelInfo channelInfo;
	private ProjectInfo projectInfo;
	private UserInfo userInfo;
	private Integer state;

	// Constructors

	/** default constructor */
	public ChannelInterface() {
	}

	/** minimal constructor */
	public ChannelInterface(ChannelInterfaceId id, ModularInfo modularInfo, InterfaceInfo interfaceInfo,
			ChannelInfo channelInfo, ProjectInfo projectInfo) {
		this.id = id;
		this.modularInfo = modularInfo;
		this.interfaceInfo = interfaceInfo;
		this.channelInfo = channelInfo;
		this.projectInfo = projectInfo;
	}

	/** full constructor */
	public ChannelInterface(ChannelInterfaceId id, ModularInfo modularInfo, InterfaceInfo interfaceInfo,
			ChannelInfo channelInfo, ProjectInfo projectInfo, UserInfo userInfo, Integer state) {
		this.id = id;
		this.modularInfo = modularInfo;
		this.interfaceInfo = interfaceInfo;
		this.channelInfo = channelInfo;
		this.projectInfo = projectInfo;
		this.userInfo = userInfo;
		this.state = state;
	}

	// Property accessors
	@EmbeddedId

	@AttributeOverrides({
			@AttributeOverride(name = "channelId", column = @Column(name = "CHANNEL_ID", nullable = false, length = 36)),
			@AttributeOverride(name = "interfaceId", column = @Column(name = "INTERFACE_ID", nullable = false, length = 36)) })

	public ChannelInterfaceId getId() {
		return this.id;
	}

	public void setId(ChannelInterfaceId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MODULAR_ID", nullable = false)

	public ModularInfo getModularInfo() {
		return this.modularInfo;
	}

	public void setModularInfo(ModularInfo modularInfo) {
		this.modularInfo = modularInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "INTERFACE_ID", nullable = false, insertable = false, updatable = false)

	public InterfaceInfo getInterfaceInfo() {
		return this.interfaceInfo;
	}

	public void setInterfaceInfo(InterfaceInfo interfaceInfo) {
		this.interfaceInfo = interfaceInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHANNEL_ID", nullable = false, insertable = false, updatable = false)

	public ChannelInfo getChannelInfo() {
		return this.channelInfo;
	}

	public void setChannelInfo(ChannelInfo channelInfo) {
		this.channelInfo = channelInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false)

	public ProjectInfo getProjectInfo() {
		return this.projectInfo;
	}

	public void setProjectInfo(ProjectInfo projectInfo) {
		this.projectInfo = projectInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")

	public UserInfo getUserInfo() {
		return this.userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	@Column(name = "STATE")

	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

}